Repository navigation
docs(adr): ADR-0161 dated note — item 17, the typed scope a search hands its adapter: record ids, or a parent object through a listed lookup - #37329
Conversation
…nds its adapter (#37324) A second dated note under the table of K8, and a second Amended bullet in the header list. The note records the maintainer's ruling on Q3 (ruling record 7168192820) and gives item 17 its final shape: the member is AdapterSearchOptions.scope, a list of terms the service builds from scope: [{ object, ids }] and the adapter applies before it ranks. No code, no schema, no changeset. The status line is left as it is. Claude-Session: https://claude.ai/code/session_01JQwxbZmjM1KubX3ZAoJPPm Co-authored-by: Claude <noreply@anthropic.com>
|
repo:cloud#1 · os-warren · session_01JQwxbW5anP6GDaVi5LKi2U 维护者速读
席位意见:建议按现稿合并。作者交给适配器的是平台换算好的过滤条件(记录 id 或某个筛选字段的 id),不是卡面写的「对象 + id」原样,这与记录第 17 项原文「由服务构建」和裁决记录「过滤条件变成该字段在 ids 内」一致,是卡面措辞不准,不是改了您裁的东西。第 ③ 处是唯一有产品语义分歧的细节,席位推荐现稿的「不参与并记日志」:两个字段取并集会把「只是引用了这份制度」的别处条款算进来,答错比答空更糟;今天零用例,等第一个真实知识源出现再用一条补充说明放开。 席位核对ACCEPT
Contract reviewServed-tier: Face: governed rules text ( ① Derived judgments
② Semver levelNone. ③ Boundary flags
④ Design judgmentThe change holds against the cited code and against the acceptance scenes of #37308 (20 records, two ids,
The bound on entries and ids is adapter-facing ("so that an adapter can rely on them") and lands on the member's TSDoc in #37308; that PR touches the published contract and owes its own review at this tier. If #37308 finds any shape here cannot be built as written, K8 rule 3 applies: it stops and the change is another dated note. Implemented-by: VERDICT: PASS |
|
repo:cloud#1 · os-warren · session_01JQwxbW5anP6GDaVi5LKi2U Hand-off for approval (Tier H,
|
Requested by Warren · project thread
Fixes #37324
Clause-②: yes
Metadata-protocol: none
维护者速读
What changes
One file under
docs/adr/:0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md, 17 lines added and none removed againstmain(829a45e9). No schema, no code, no changeset.K8 item 17 of ADR-0161 ("A typed scope filter") reads "Deferred" with no final shape, and K8 rule 3 says a shape that cannot be built as written changes by "a dated note on this record". This PR is that note. It records the maintainer's ruling on Q3, record
7168192820on #37308: 「也能指定上级对象(制度)」. #37308 builds the member after this note merges; #37311 (row 12) adds thesearch_knowledgearguments.docs/adr/**is Tier H: the maintainer merges this PR; no seat approves, merges or enqueues it.Two additions, in the form PR #37263 used for the #37097 note:
Amendedbullet at the end of the header list, pointing at the note. TheStatus:line is byte-identical, so the generateddocs/adr/README.mddoes not change.What the note decides. Each ◆ is a shape the note decides past the ruling's words, for the approver to accept with the record or strike:
AdapterSearchOptions.scope?, a list of terms:{ kind: 'record', ids }(the document'ssourceRecordIdinids) or{ kind: 'metadata', field, ids }(the document'smetadata[field]inids, or a list with an element inids). The adapter gets resolved terms, never{ object, ids }: turning an object into a field needs the object's registered definition, which is the platform's (K1).organizationIds: absent ranks every document as before; present filters BEFORE ranking sotopKis filled from in-scope documents; an empty list ranks nothing and is never "no filter".organizationIds,scopeand the opaquefilterall apply.KnowledgeSearchOptions.scope(entries ofobjectandids), per source: the source's own object gives arecordterm; another object gives ametadataterm for themetadataFieldsmember that points at it; no such member, and the entry does not reach the source. A source no entry reaches is not searched; afileorhttpsource answers nothing under a scope.recordterm only; (3) onlylookupandmaster_detailare parent links, target read throughreferenceTargetOf; auserfield is not one; a withheld field is not one; (4) a source that lists two or more lookups to the entry's object is not reached by it, logged once per source naming the fields.KnowledgeHit.sourceRecordIdandKnowledgeHit.metadata[field], fail closed. No capability flag is added (K8 rule 5); the service logs once per adapter the first time its check drops a hit.metadataFieldsmember an index carries to be queryable by the caller, so "that field in ids" is a filter the caller could run on the object's own rows; the parent row is never read.filterstays as it is, handed through and checked by nothing in the service; whether it retires is its own card.runKnowledgeAdapterContract, per term kind, and one through a realKnowledgeServiceover an adapter that ignores the member.KnowledgeSearchOptions.scope(service-knowledge: search takes a record scope (scope: [{ object, ids }]) and hands adapters a typed filter they apply before ranking #37308, coded refusal, ADR-0112), the tool argument (search_knowledge: the one definition gains scope, granularity and groupBy, for the MCP door and the in-app agent alike #37311), record-level return (service-knowledge: search returns records, not chunks — granularity and groupBy #37103).One shape differs from #37324's body words. That body says the member on
AdapterSearchOptionsisscope: [{ object, ids }]. The note keeps[{ object, ids }]on the service option only and hands the adapter resolved terms, as #37308's item 1 and K8 item 17 itself say ("built by the service from"). The member name isscopeon both interfaces, with distinct types.Tests
No test changes: the diff is one Markdown file. The derived gate families were run at
8a64f99f, the head.Local gates at 8a64f99: 21 derived, 21 run, all exit 0
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 21 commands from the branch's change set (1 path against merge base829a45e9). Each was run with its output redirected to a file and its exit code read before any pipe.check:doc-formula-expressionsneeds@objectstack/formulaand@objectstack/lintbuilt: built first under the verify lock,VERDICT command-exit 0.node scripts/check-adr-links.mjsnode scripts/check-adr-links.mjs --self-testnode scripts/check-closing-keyword-parity.mjsnode scripts/check-closing-keyword-parity.mjs --self-testnode scripts/check-comment-mask-corpus.mjsnode scripts/ci/plan-test-core-shards.mjs --self-testpnpm --filter @objectstack/lint run check:doc-formula-expressionspnpm check:adr-anchorspnpm check:adr-indexpnpm check:adr-symbol-anchorspnpm check:ci-filter-paritypnpm check:closed-ceremony-textpnpm check:cross-package-test-inputspnpm check:doc-authoringpnpm check:driver-memory-censuspnpm check:gitlink-declaredpnpm check:nul-bytespnpm check:pm-governed-mergespnpm check:pm-prior-rulingspnpm check:refd-timer-probepnpm check:watch-hint-literalReconciliation,
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --ranwith the exit codes recorded:check:adr-symbol-anchorsresolves the note's fourpath#symbolcitations. Outside the derived set and not run locally: the governed-merges audit with workflow-only variables, CI's test-core shard planning steps, and the type-check lanes (the diff touches no TypeScript). CI carries them.Acceptance notes
metadataFieldstoday, so no measured consumer decides it; empty-now can open later without removing anyone's hits.userfield: excluded as a parent link. The visible cost:Field.lookup('sys_user')is a link whileField.user()is not. Nothing scopes by user today; it returns by a dated note with its reader.filterhas no producer in this tree (the one non-test caller ofIKnowledgeService.search,createKnowledgeTools, passes none) and gets no service guarantee. The note leaves it unchanged; whether to retire it is a question for its own card. Noted, not filed: carrier none.KnowledgeSearchOptions.scopeor an entry with no ids is answered empty or refused (the note fixes only that it never reads as "no scope"); the bound numbers; log levels.docs/adr/**publishes nothing; the PR carriesskip-changeset.scripts/adr-anchorsentry.pnpm check:adr-anchorsexits 0 without one; the code PR anchors the member it lands.Verification
Read first:
filterstays as it is" bullet.Two-minute check: open this PR's Files tab. It shows one file under
docs/adr/, +17 −0: oneAmendedbullet at the end of the header list, and one blockquote between the #37097 note and the paragraph that starts "What "capabilities" became.".Generated by Claude Code